﻿<div class="menu">
<div class="menu-fix">
<ul id="menu">
	<?
				$rs = $db->query("select * from ".$prefix."loaisanpham where c_hienthi = 1 and c_id_cha = 0 order by c_thutu ASC");
				while($row = $db->fetch_array($rs)){
					$c_ten = stripslashes($row[c_ten]);
					$c_id = $row[c_id];				
	?>
	<li class="top"><a href="<?=$root?>/danh-muc-san-pham/<?=$c_id?>/<?=$myString->vietdecode($c_ten)?>" class="top_link"><span class="down"><?=$c_ten?></span></a>
    	<ul class="sub">
        <?
			$rs2 = $db->query("select * from ".$prefix."loaisanpham where c_hienthi = 1 and c_id_cha = ".$c_id." order by c_thutu ASC");
			while($row2 = $db->fetch_array($rs2)){
				$c_ten2 = stripslashes($row2[c_ten]);
				$c_id2 = $row2[c_id];
		?>
        	<li><a href="<?=$root?>/danh-muc-san-pham/<?=$c_id2?>/<?=$myString->vietdecode($c_ten2)?>"><span><?=$c_ten2?></span></a>	
            	<ul>
                <?
				$rs3 = $db->query("select * from ".$prefix."loaisanpham where c_hienthi = 1 and c_id_cha = ".$c_id2." order by c_thutu ASC");
				while($row3 = $db->fetch_array($rs3)){
					$c_ten3 = stripslashes($row3[c_ten]);
					$c_id3 = $row3[c_id];
				?>
                	<li><a href="<?=$root?>/danh-muc-san-pham/<?=$c_id3?>/<?=$myString->vietdecode($c_ten3)?>"><span><?=$c_ten3?></span></a>
                    </li>                                  
                <? } ?>
                </ul>  
            </li>                   
        <? } ?>
        </ul> 
    </li>
    <? }?>
</ul>
</div>
</div>
<div id="menu-bottom"></div>
<div class="clearfix"></div>